import axios from './http'
import components from './utils/components'
import crypto from './utils/crypto'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import VueCookies from 'vue-cookies'
import { checkPermission } from './utils/index'
import { message } from './utils/message'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import 'babel-polyfill'

Vue.config.productionTip = false

Vue.use(ElementUI)
Vue.use(VueCookies)
Vue.use(components)

Vue.prototype.$axios = axios
Vue.prototype.$crypto = crypto
Vue.prototype.$checkPermission = checkPermission
Vue.prototype.$message = message
Vue.prototype.$baseUrl =
  process.env.NODE_ENV === 'production'
    ? `${window.location.protocol}//${window.location.host}`
    : `${window.location.protocol}//192.168.3.21:10083`

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app')
